Skip to content

Instantly share code, notes, and snippets.

@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
@shaps80
shaps80 / Font.swift
Last active May 21, 2024 09:52
A set of UIFont/NSFont helpers that matches the equivalent SwiftUI Font API. (Supports iOS 13+ and macOS 10.15+)
import SwiftUI
#if os(macOS)
public typealias Font = NSFont
public typealias FontDescriptor = NSFontDescriptor
#else
public typealias Font = UIFont
public typealias FontDescriptor = UIFontDescriptor
#endif
@shamil
shamil / mount_qcow2.md
Last active May 21, 2024 09:52
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 21, 2024 09:52
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@mirceast
mirceast / Inference_PyTorch.py
Last active May 21, 2024 09:51
Inference with PyTorch
# Add the path to torchvision - change as needed
import sys
sys.path.insert(0, '/home/mircea/python-envs/env/lib/python3.6/site-packages/vision')
# Choose an image to pass through the model
test_image = 'images/dog.jpg'
# Imports
import torch, json
import numpy as np
@simonista
simonista / .vimrc
Last active May 21, 2024 09:46
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@varqox
varqox / recording_application_and_microphone.md
Last active May 21, 2024 09:46
How to record multiple applications and microphone into one audio file on Linux using PulseAudio

How to record multiple applications and microphone into one audio file on Linux

Step 0. Terminology

Sinks are for output, sources are for input. To stream source to sink a loopback must be created. More shall you find there.

Step 1. Create output sink that will be recorded

Our output sink will be named recording.

pacmd load-module module-null-sink sink_name=recording sink_properties=device.description=recording
@roustem
roustem / openssl.md
Created July 29, 2018 17:56 — forked from NoMan2000/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@rhshah
rhshah / pip.md
Created January 16, 2018 22:27 — forked from saurabhshri/pip.md
Install and use pip in a local directory without root/sudo access.

#Install and use pip in a local directory without root/sudo access. #####By: @saurabhshri

##Why? Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

##How?

@soerenkornetzki
soerenkornetzki / dotnet-framework-and-dotnet-standard-compatibility-list-with-operating-systems.md
Last active May 21, 2024 09:40
.NET Framework (and .NET Standard) Compatibility List with Operating Systems

.NET Framework (and .NET Standard) Compatibility List with Operating Systems

This summary/conclusion will not be updated anymore. I have switched to .NET 5 completely, which runs on Windows 7 SP1 and newer.

For class libraries, I will use the targets .NET Standard 1.1, 2.0 and 2.1 at the same time, together with .NET Framework 2.0 and 4.0. Applications on the other hand will always targeted to .NET 5.0 only.

Recommended minimum system requirements